<table id="pagetop" cellpadding="0" cellspacing="0">
	<tr id="branding"><td><h1 id="textpattern">Textpattern</h1></td><td id="navpop">
		<form method="get" action="<?= $this->urlTo('/'); ?>" class="navpop" style="display: inline;">
			<select name="event" onchange="submit(this.form);">
				<option>Go&#8230;</option>
<?php foreach ($tabs as $tab => $subtabs): ?>
<?php if (!empty($subtabs)): ?>
				<optgroup label="<?= ucwords(str_replace('_', ' ', $tab)) ?>">
<?php foreach ($subtabs as $subtab): ?>
					<option value="<?= "/{$tab}/{$subtab}" ?>"><?= ucwords(str_replace('_', ' ', $subtab)) ?></option>
<?php endforeach; ?>
				</optgroup>
<?php endif; ?>
<?php endforeach; ?>
			</select>
		</form>
	</td></tr>
	
	<tr id="nav-primary">
		<td align="center" class="tabs" colspan="2">
			<table cellpadding="0" cellspacing="0" align="center">
				<tr>
					<td id="messagepane">&nbsp;</td>
<?php foreach ($tabs as $tab => $subtabs): ?>
<?php if (!empty($subtabs)): ?>
					<td class="<?= ($tab === $selected_tab) ? 'tabup' : 'tabdown' ?>"><a href="<?= $this->urlTo("/{$tab}") ?>" class="plain"><?= ucwords(str_replace('_', ' ', $tab)) ?></a></td>
<?php endif; ?>
<?php endforeach; ?>
					<td id="view-site" class="tabdown"><a href="<?= $site_url ?>" class="plain" target="_blank">View Site</a></td>
				</tr>
			</table>
		</td>
	</tr>
	
	<tr id="nav-secondary">
		<td align="center" class="tabs" colspan="2">
			<table cellpadding="0" cellspacing="0" align="center">
				<tr>
<?php if (!empty($tabs[$selected_tab])): ?>
<?php foreach ($tabs[$selected_tab] as $subtab): ?>
					<td class="<?= ($subtab === $selected_subtab) ? 'tabup' : 'tabdown' ?>"><a href="<?= $this->urlTo("/{$selected_tab}/{$subtab}") ?>" class="plain"><?= ucwords(str_replace('_', ' ', $subtab)) ?></a></td>
<?php endforeach; ?>
<?php endif; ?>
				</tr>
			</table>
		</td>
	</tr>
	
</table>
